package com.example.bigevent.pojo;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;

@Component
public class Father implements InitializingBean, DisposableBean {

    @Autowired
    private Son son;

    @Override
    public void destroy() throws Exception {
        //System.out.println("destroy");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        //System.out.println("afterPropertiesSet");
    }

    @PostConstruct
    public void initMethod() {
        System.out.println("PostConstruct");
    }

    @PreDestroy
    public void destoryMethod() {
        System.out.println("PreDestroy");
    }
}
